<?xml version='1.0' encoding='UTF-8' ?>
<ui:composition template="template.xhtml" xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ice="http://www.icesoft.com/icefaces/component"
                xmlns:odr="http://java.sun.com/jsf/composite/odr">

    <ui:define name="head">
    </ui:define>

    <ui:define name="pagetitle">
        <ice:outputText value="#{page['iteration.page.title']}" nospan="true" />
        <ice:outputText value="#{iterationController.name}" rendered="#{iterationController.valid}" nospan="true"/>
    </ui:define>

    <ui:define name="content">
        <ice:form id="iterationForm" partialSubmit="false">
            <h1><h:outputText value="#{form['iteration.heading']}"/></h1>

            <div class="formSectionineRemover">

                <div class="formSection">
                    <ice:outputLabel value="#{form['label.name']}" for="inName"/>
                    <ice:outputText value="#{form['constraint.required']}" styleClass="required" />
                    <ice:inputText id="inName"
                                   label="#{form['label.name']}"
                                   maxlength="255"
                                   value="#{iterationController.name}"
                                   partialSubmit="true"
                                   required="true">
                        <f:validateLength minimum="3" maximum="30" />
                        <f:validator validatorId="RegexValidator" />
                        <f:attribute name="inputCharset" value="A-Za-z0-9-_ " />

                        <f:validator validatorId="UserNameValidator" />
                    </ice:inputText>
                    <p>
                    <ice:outputText value="#{form['constraint.minlength']}" nospan="true" /> 3;
                    <ice:outputText value="#{form['constraint.maxlength']}" nospan="true" /> 30;
                    <ice:outputText value="#{form['constraint.charset']}" nospan="true" /> [A-Za-z0-9-_ ];
                    <ice:outputText value="#{form['constraint.username']}" nospan="true" />
                    </p>
                </div>





                <div class="formSection">
                    <ice:outputLabel value="#{form['label.description']}" for="inDescription" />
                    <ice:inputTextarea id="inDescription"
                                   label="#{form['label.description']}"
                                   maxlength="255"
                                   partialSubmit="true"
                                   value="#{iterationController.description}">
                    </ice:inputTextarea>
                    <p>
                    <ice:outputText value="#{form['iteration.description']}" nospan="true" /> 0;
                    </p>
                </div>

                <odr:datespan
                    endDate="#{iterationController.endDate}"
                    startDate="#{iterationController.startDate}"
                    startDateLabel="#{form['iteration.startDate']}"
                    endDateLabel="#{form['iteration.endDate']}"
                    timeLabel="#{form['label.date']}"
                    />

                <!--Submit Button-->
                <ice:commandButton actionListener="#{iterationController.submitForm}"
                                   id="submit"
                                   partialSubmit="true"
                                   value="#{form['button.submit']}"
                                   styleClass="confirm"/>


                <!--Reset Button-->
                <ice:commandButton actionListener="#{iterationController.abortForm}"
                                   id="reset"
                                   value="#{form['button.cancel']}"
                                   immediate="true"
                                   partialSubmit="true"
                                   styleClass="abort"
                                   type="abort" />
            </div>
        </ice:form>
    </ui:define>

    <!--SIDEBAR-->
    <ui:define name="sidebar">
        <div id="help">
            <ul class="info">
                <li class="messages">
                    <div class="header"></div>
                    <div class="text">
                        <ice:messages layout="list"
                                      errorClass="error"
                                      warnClass="warning"
                                      fatalClass="fatal"
                                      infoClass="information" />
                    </div>
                </li>
                <li>
                    <div class="header">
                        <img src="resources/images/info.png" alt="information" />
                    </div>
                    <div class="text">
                        <h2>Iwas tolles :D</h2>
                        content?
                    </div>
                </li>
            </ul>
        </div>
    </ui:define>
</ui:composition>